﻿<controls:ChildWindow x:Class="Locator.Silverlight.Client.ResultDetails"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="600" Height="300" 
           Title="Store Inventory Details" DataContext="{Binding ResultDetails, Source={StaticResource Locator}}">
    <ContentControl.Resources>
        <DataTemplate x:Key="ResultHeaderTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Product.Name}" Margin="0" Width="400" />
                <TextBlock Text="{Binding NumberInStock}" Margin="0" Width="50" />
            </StackPanel>
        </DataTemplate>
    </ContentControl.Resources>
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBlock Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="12,12,0,0" Name="textBlockAddress" Text="{Binding Address}" FontSize="14" />
        <ScrollViewer HorizontalAlignment="Center" Margin="12,41,0,12" Name="scrollViewerResults" VerticalAlignment="Stretch" Width="489">
            <Border Background="WhiteSmoke">
                <StackPanel Background="SkyBlue">
                    <StackPanel Orientation="Horizontal" Background="CornflowerBlue">
                        <TextBlock Text="Product" Margin="0" TextWrapping="Wrap" Width="400" FontSize="12" />
                        <TextBlock Text="Amount" Margin="0" TextWrapping="Wrap" Width="50" FontSize="12" />
                    </StackPanel>
                    <ItemsControl x:Name="itemsControlStores" ItemsSource="{Binding InventoryInfo}" Margin="0">
                        <ItemsControl.ItemTemplate>
                            <StaticResource ResourceKey="ResultHeaderTemplate"/>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </StackPanel>
            </Border>
        </ScrollViewer>
        <!--<Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />-->
        <Button x:Name="OKButton" Content="Close" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1"></Button>
    </Grid>
</controls:ChildWindow>